package com.sanyue.thread;

import org.junit.Test;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author sanyue
 * @version 1.0
 * @description: TODO
 * @date 2022/3/3 下午9:07
 */
public class testLoopIsQuick {
    @Test
    public void fun1(){
        int[][] nums = new int[10000][1000];

        new Thread(()->{
            int a;
            long time = System.currentTimeMillis();
            for (int i = 0; i < 1000; i++) {
                for (int j = 0; j < 10000; j++) {
                    a = 1;
                }
            }
            long time2 = System.currentTimeMillis();
            System.out.println("B:"+ (time2 - time));
        },"B").start();

        new Thread(()->{
            int a;
            long time = System.currentTimeMillis();
            for (int i = 0; i < 10000; i++) {
                for (int j = 0; j < 1000; j++) {
                     a = 1;
                }
            }
            long time2 = System.currentTimeMillis();
            System.out.println("A:"+ (time2 - time));
        },"A").start();

        new Thread(()->{
            int a;
            long time = System.currentTimeMillis();
            for (int i = 0; i < 1000; i++) {
                for (int j = 0; j < 10000; j++) {
                    a = 1;
                }
            }
            long time2 = System.currentTimeMillis();
            System.out.println("C:"+ (time2 - time));
        },"C").start();

        new Thread(()->{
            int a;
            long time = System.currentTimeMillis();
            for (int i = 0; i < 10000; i++) {
                for (int j = 0; j < 1000; j++) {
                    a = 1;
                }
            }
            long time2 = System.currentTimeMillis();
            System.out.println("D:"+ (time2 - time));
        },"D").start();

    }
}
